package com.example.userlogin;

import java.util.HashMap;

import com.example.userlogin.DBController;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

public class UsrActivity extends Activity {
	
	private static final String LOGCAT = null;

	EditText userName;
	EditText password;
	EditText email;
	DBController controller = new DBController(this);
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.register);
		
		Log.d(LOGCAT,"Created");
	}
	
	public void add(View view) {
		EditText userName = (EditText) findViewById(R.id.rg_unt);
		EditText password = (EditText) findViewById(R.id.rg_pat);
		EditText email = (EditText) findViewById(R.id.rg_emt);
		HashMap<String, String> queryValues =  new  HashMap<String, String>();
		queryValues.put("userName", userName.getText().toString());
		queryValues.put("password", password.getText().toString());
		queryValues.put("email", email.getText().toString());
		controller.insert(queryValues);
		this.callHomeActivity(view);
		
		Log.d(LOGCAT,"Function add user_activity");
	}
	public void callHomeActivity(View view) {
		Intent objIntent = new Intent(UsrActivity.this, Register.class);
		startActivity(objIntent);
		
		Log.d(LOGCAT,"Created Function callHome...");
	}	

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.usr, menu);
		return true;
	}

}




